﻿using System.Globalization;
using Catel;
using Catel.IoC;
using Catel.Services;

namespace YtbDownloader.Properties;

public class LanguageDesignTimeInitializer : DesignTimeInitializer
{
    protected override void Initialize()
    {
        var resourcesSource = new LanguageResourceSource("YtbDownloader", "YtbDownloader.Locales", "Lang");
        ServiceLocator.Default.ResolveRequiredType<ILanguageService>().FallbackCulture = new CultureInfo("en-US");
        ServiceLocator.Default.ResolveRequiredType<ILanguageService>().RegisterLanguageSource(resourcesSource);
    }
}